import factory from './factory'

export default {
  async getUserSceneList() {
    const {
      url,
      options,
    } = factory({ serviceName: 'getUserSceneList' })
    const res = await fetch(url, { ...options }).then(res => res.json())
    return res
  },
  async getUserDeviceList() {
    const {
      url,
      options,
    } = factory({ serviceName: 'getUserDeviceList' })

    const res = await fetch(url, { ...options }).then(res => res.json())
    return res
  },
  async getUserScene({ scene_id }) {
    const {
      url,
      options,
    } = factory({
      serviceName: 'getUserScene',
      serviceArguments: {
        scene_id,
      },
    })

    const res = await fetch(url, { ...options }).then(res => res.json())
    return res
  },
}